/**
 * @projectName demo-master
 * @fileName UserService.java
 * @packageName org.example.nacos.mysql.service
 * @author xaoyaoyao
 * @date 2021/3/29 16:25
 * @version V1.0
 * @copyright (c) 2021, xaoyaoyao@aliyun.com All Rights Reserved.
 */
package org.example.nacos.mysql.service;

import org.example.nacos.mysql.dao.UserRepository;
import org.example.nacos.mysql.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @className UserService
 * @description
 * @author xaoyaoyao
 * @date 2021/3/29 16:25
 */
@Service
public class UserService {

	private final UserRepository userRepository;

	@Autowired
	public UserService(UserRepository userRepository) {this.userRepository = userRepository;}

	public User findById(Long id) {
		return userRepository.findById(id).orElse(null);
	}
}
